/********************************************************************
 
 Copyright (C), 2012年 dhc. All rights reserved.
 
 Filename: 	    MailList.h 

 Author:        muzongcun
 
 Version:       1.0
 
 Description:   maillist
 
 History:
 
 muzongcun    2012/3/10     1.0     Create 
 38bfff  蓝色色值 字号规定三种：24  30  36   
 邮件列表的高度是128    45*33
 *********************************************************************/
#import <UIKit/UIKit.h>
#import "BaseTableViewController.h"
#import "UserTaskDelegate.h"
#import "EGORefreshTableFooterView.h"
#import "EGORefreshTableHeaderView.h"
#import "ToolDrawerView.h"
#import "TKLoadingAnimationView.h"

#define ReceiveMail 0   //收件箱
#define ToSendMail  1   //发件箱
#define SendMail    2   //已发送邮件
#define InvalidMail 3   //垃圾箱
#define MergeMail   4   //未归并邮箱

//刷新数据的类型
typedef enum _REFRESH_TYPE 
{
    NORMAL_FRESH,   //正常点击按钮 刷新数据
    TRIGGER_FRESH   //上下拖拽刷新数据
} RefreshType;

@interface MailList : BaseTableViewController
<UserTaskDelegate > 
{
    int                 m_startRow;
    UIButton*           m_mergeBut;             //浮动窗口的合并按钮
    UILabel*            m_barTitleLabel;        //箱体类型名字

    int                 m_mailListType;
    ToolDrawerView*     m_toolDrawerView;   //弹出菜单的控件
    NSMutableArray*     m_mutableArray;     //动态存放所有maillist中数据
    UIButton*           m_mailNumTotal;     //删除合并邮件数量累价
    NSMutableArray*     m_checkedArray;     //动态存放选中数据
    NSMutableArray*     m_importantArray;   //设置是否重要数据
    NSString*           m_searchText;
    
    UINavigationBar*    m_navBar;           //自己创建
    RefreshType         m_refreshType;      //刷新数据的类型
    UISearchBar*        m_mailSearchBar;    //查找bar
    NSString*           m_employeeID;       //员工id
    NSString*           m_selectClientID;   //保存选择的客户id
    NSString *          m_searchScopeType;  //查找不同的类型（发件人和邮件标题）
    BOOL                m_bIsSearching;     //是否进程查找
    
    TKLoadingAnimationView*     m_spinner;  //菊花转动
    UISearchDisplayController*  m_searchDisplayController;
}
@property(nonatomic, assign)  BOOL                       m_bIsSearching; 
@property(nonatomic, retain)  NSString*                  m_searchText;
@property(nonatomic, retain)  UILabel*                   m_barTitleLabel;
@property(nonatomic, retain)  NSString*                  m_employeeID;
@property(nonatomic, retain)  NSString*                  m_selectClientID;
@property(nonatomic, retain)  NSMutableArray*            m_mutableArray;
@property (nonatomic, retain) IBOutlet UIButton*         m_mailNumTotal;
@property(nonatomic, retain)  IBOutlet UISearchBar*      m_mailSearchBar;
@property (nonatomic, retain) IBOutlet UITableView*      m_table;
@property (nonatomic, retain) IBOutlet ToolDrawerView*   m_toolDrawerView;
@property(nonatomic, retain)  IBOutlet NSMutableArray*   m_checkedArray;
@property(nonatomic, retain)  IBOutlet NSMutableArray*   m_importantArray;
@property (nonatomic, retain) UISearchDisplayController* m_searchDisplayController;

-(void)     refreshData;
-(void)     getMoreData;
-(void)     refresh;
-(void)     SetMailListType:(int)type;

//导航栏按钮的事件响应
-(void)     onWriteMail;
-(void)     onNavigation;
-(void)     OnSearchMail;

//弹出菜单的按钮响应事件
-(void)     doSearch;
-(void)     onDelete;
-(void)     onMerge;
-(void)     onShow;
-(void)     onHide;

-(void)     makeLeftViewVisible;
-(void)     makeRightViewVisible; 

-(void)     setImportFlag:(NSString*)strTag;

//得到正确的ip地址去掉
-(void)GetMailAddress:(NSString*)strAddr;

//去掉 < > 提取邮件地址
-(NSString*) getAddress:(NSString*) originMailAddr;

@end
